package protocol;

import java.util.Iterator;

import org.json.simple.JSONObject;

public abstract class HTTPPart implements HTTPPartInterface{
	protected JSONObject fHeaders;
	protected JSONObject getfHeaders() {
		return fHeaders;
	}

	public HTTPPart(){
		fHeaders = new JSONObject();
	}
	
	@SuppressWarnings("rawtypes")
	public String toString(){
		String str = new String();
		for(Iterator iterator = fHeaders.keySet().iterator(); iterator.hasNext();) {
		    String key = (String) iterator.next();
		    str += key + ": " + fHeaders.get(key) + "\n";
		}
		return str;
	}

}
